/*! lzf */

var base = function (r) {
    return r.back = function (t) {
        var e = "", i = window.location.href;
        0 < document.referrer.length && (e = document.referrer), "undefined" != typeof opener && null != opener && 0 == e.length && 0 < opener.location.href.length && (e = opener.location.href), e && 1 != history.length && (e.match("zufun.cn") || e.match("yizhaofang.cn")) ? history.go(t) : i.match("platform") ? window.location.href = "https://m.zufun.cn/platform?closeMobile=true" : i.match("/user") ? window.location.href = "https://m.zufun.cn/user" : window.location.href = "https://m.zufun.cn/?closeMobile=true"
    }, r.is_weixn = function () {
        var t = navigator.userAgent.toLowerCase();
        return "micromessenger" == t.match(/MicroMessenger/i) && !/iphone|ipad|ipod/.test(t)
    }, r.numToChinese = function (t) {
        if (isNaN(t)) return "N";
        var e = ["", "", "十", "百", "千", "万", "十万", "百万", "千万", "亿"],
            i = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"], n = new String(t);
        if (9 < n.length) return "N";
        for (var r, o = t < 0 ? "负" : "", a = !1, s = 0; s < n.length; s++) 0 == (r = parseInt(n.substr(s, 1))) ? a = !0 : (1 == a && (o += "零", a = !1), e[n.length - s].length <= 1 || s + 1 < n.length && 0 == parseInt(n.substr(s + 1, 1)) ? o += i[r] + e[n.length - s] : o += i[r] + e[n.length - s].substr(0, 1));
        return o
    }, r.alert = function (t) {
        var e;
        "" != t && void 0 !== t || (t = "正在加载"), e = '<div id="Loading" style="position:absolute; z-index:1000; width:100%; background-color: #4e4e4e;top:60px;text-align: center;color: #f8f8f8;padding: 10px 15px;font-size:16px;border-radius:3px;"><div class="spinner" style="float:left;margin-right:10px;"><img src="images/loading.svg" width="24" height="24"></div><span>' + t + "</span></div>", $("body").append(e)
    }, r.alertClose = function () {
        $("#loading").remove()
    }, r.jugePostData = function (t) {
        var e = !0;
        for (var i in t) {
            var n = t[i];
            if ("" == n || void 0 === n) {
                e = !1;
                break
            }
        }
        return e
    }, r.loading = function (t) {
        $(".loading").eq(0).remove();
        t = t || {};
        this.__holder = "body", this.__msg = t.msg || "努力加载中", this.__remove = t.remove || !1, this.__spinner = t.spinner || !0, this.__html = "<span>" + this.__msg + "</span>", "init" == this.__spinner && (this.__html = this.__msg), $(this.__holder).append("<div class='loading'>" + this.__html + "</div>"), this.__remove && setTimeout(function () {
            $(".loading").remove()
        }, 2e3)
    }, r.getArgs = function () {
        var t = new Object;
        query = location.search.substring(1), pairs = query.split("&");
        for (var e = 0; e < pairs.length; e++) {
            var i = pairs[e].indexOf("=");
            if (-1 != i) {
                var n = pairs[e].substring(0, i), r = pairs[e].substring(i + 1);
                r = decodeURIComponent(r), t[n] = r
            }
        }
        return t
    }, r.getElementLeft = function (t) {
        for (var e = t.offsetLeft, i = t.offsetParent; null !== i;) e += i.offsetLeft, i = i.offsetParent;
        return e
    }, r.getElementTop = function (t) {
        for (var e = t.offsetTop, i = t.offsetParent; null !== i;) e += i.offsetTop, i = i.offsetParent;
        return e
    }, r.appendBox = function (t) {
        this._target = t.target, this._dom = t.dom, this._offset = t.offset, $(".zufun_good").remove();
        var e = this._target.offset();
        this._div = document.createElement("div"), this._div.className = "zufun_good", this._div.style.position = "absolute", this._div.style.left = e.left + this._target.width() + this._offset.x + "px", this._div.style.top = e.top + this._offset.y + "px", this._div.innerHTML = this._dom, $("body").append(this._div)
    }, r.removeBox = function () {
        $(".zufun_good").remove()
    }, r.alertMsg = function (t) {
        $(".alertMsg").remove(), this._text = t.text, this._color = "#000", this._time = 2e3, this._offset = {
            x: "0px",
            y: "120px"
        }, this._postion = t.position || "top", void 0 !== t.color && (this._color = t.color), void 0 !== t.offset && (this._offset = t.offset), void 0 !== t.time && (this._time = t.time), this._div = document.createElement("div"), this._div.style.width = "100%", this._div.style.height = "35px", this._div.style.position = "fixed", this._div.className = "alertMsg", this._div.style.zIndex = "99999", this._div.style.textAlign = "center", this._div.style.filter = "alpha(opacity=60)", "center" == this._postion ? (this._div.style.top = "0px", this._div.style.left = "0px", this._div.style.bottom = "0px", this._div.style.right = "0px", this._div.style.margin = "auto") : (this._div.style.top = this._offset.y, this._div.style.left = this._offset.x);
        var e = '<span style="position:relative; color:#fff; padding:8px 40px; border-radius:2px; background-color:#000; opacity:0.6; filter:alpha(opacity=60); margin:0 auto; display:inline-block;">' + this._text + "</span>";
        this._div.innerHTML = e, document.body.appendChild(this._div), setTimeout(function () {
            $(".alertMsg").remove()
        }, this._time)
    }, r.trim = function (t, e) {
        var i = "";
        return i = t.replace(/(^\s+)|(\s+$)/g, ""), "g" == e.toLowerCase() && (i = i.replace(/\s/g, "")), i
    }, r.site_url = function (t) {
        var e = t || "";
        return $.trim(window.location.protocol + "//" + window.location.host + "/" + e)
    }, r.button_loading = function (t, e) {
        var i = null, n = e || 0, r = !0;
        return t ? (i = $(t).find("button").eq(n)).length <= 0 && (r = !1, i = $(t).find("input[type='submit']").eq(0)) : i = $(".ui-dialog-autofocus").eq(n), r ? "加载..." != i.text() && (i.text("加载..."), !0) : "加载..." != i.val() && (i.val("加载..."), !0)
    }, r.reset_button = function (t, e, i) {
        var n = null, r = (e = e || "确定", i = i || 0, !0);
        t ? (n = $(t).find("button").eq(i)).length <= 0 && (r = !1, n = $(t).find("input[type='submit']").eq(0)) : n = $(".ui-dialog-autofocus").eq(i), r ? n.text(e) : n.val(e)
    }, r.lock = function (t) {
        return $(t).find('input[type="submit"],button').attr("disabled", !0), !0
    }, r.unlock = function (t) {
        $(t).find('input[type="submit"],button').attr("disabled", !1)
    }, r.flash_version = function () {
        var t = 0;
        if (document.all) try {
            var e;
            (e = new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) && (1, VSwf = e.GetVariable("$version"), t = parseInt(VSwf.split(" ")[1].split(",")[0]))
        } catch (t) {
        } else if (navigator.plugins && 0 < navigator.plugins.length && (e = navigator.plugins["Shockwave Flash"])) {
            1;
            for (var i = e.description.split(" "), n = 0; n < i.length; ++n) isNaN(parseInt(i[n])) || (t = parseInt(i[n]))
        }
        return t
    }, r.data_browser = [{string: navigator.userAgent, subString: "Chrome", identity: !1}, {
        string: navigator.userAgent,
        subString: "OmniWeb",
        versionSearch: "OmniWeb/",
        identity: !1
    }, {string: navigator.vendor, subString: "Apple", identity: "Safari", versionSearch: !1}, {
        prop: window.opera,
        identity: !1
    }, {string: navigator.vendor, subString: "iCab", identity: !1}, {
        string: navigator.vendor,
        subString: "KDE",
        identity: !1
    }, {string: navigator.userAgent, subString: "Firefox", identity: !1}, {
        string: navigator.vendor,
        subString: "Camino",
        identity: !1
    }, {string: navigator.userAgent, subString: "Netscape", identity: !1}, {
        string: navigator.userAgent,
        subString: "MSIE",
        identity: !0,
        versionSearch: "MSIE"
    }, {
        string: navigator.userAgent,
        subString: "Gecko",
        identity: !1,
        versionSearch: "rv"
    }, {
        string: navigator.userAgent,
        subString: "Mozilla",
        identity: !1,
        versionSearch: "Mozilla"
    }], r.is_ie = function () {
        for (var t = r.data_browser, e = 0; e < t.length; e++) {
            var i = t[e].string, n = t[e].prop;
            if (this.versionSearchString = t[e].versionSearch || t[e].identity, i) {
                if (-1 != i.indexOf(t[e].subString)) return t[e].identity
            } else if (n) return t[e].identity
        }
    }, r.fuck_ie_version = function (t) {
        navigator.appName;
        var e = navigator.appVersion.split(";");
        if (1 < e.length && parseInt(e[1].replace(/[ ]/g, "").replace(/MSIE/g, "")) < t) return !0;
        return !1
    }, r.reload = function (t) {
        t = t || "操作成功";
        base.alertMsg({text: t}), window.location.reload()
    }, r.drop_tips = function (a) {
        if ("searchModal" == a.type) var s = a.input, t = a.holder; else s = $(a.input), t = a.holder || "body";
        var l = $('<div id="drop_tips_wrap" class="drop-tips-wrap"></div>'),
            e = a.top || s.offset().top + s.outerHeight() - 1, i = a.left || s.offset().left;
        "app" != a.platform && l.css({top: e + "px", left: i + "px", width: s.innerWidth() + "px"});
        var d = "", n = !0, p = function () {
            l.hide()
        }, r = function (t) {
            if ("block" == l.css("display") && 38 == t.keyCode || 40 == t.keyCode) {
                var e = l.find(".drop-tip-item.hover");
                if (38 == t.keyCode) if (0 < e.length) {
                    var i = e.removeClass("hover").prev();
                    0 < i.length && (i.addClass("hover"), d = i.attr("data-value"), s.val(d))
                } else {
                    var n = l.find(".drop-tip-item:last");
                    n.addClass("hover"), d = n.attr("data-value"), s.val(d)
                } else if (40 == t.keyCode) if (0 < e.length) {
                    var r = e.removeClass("hover").next();
                    0 < r.length && (r.addClass("hover"), d = r.attr("data-value"), s.val(d).attr("data-id", r.attr("data-id")))
                } else {
                    var o = l.find(".drop-tip-item:first");
                    o.addClass("hover"), d = o.attr("data-value"), s.val(d)
                }
            }
        }, o = function (t) {
            n && (setTimeout(function () {
                n = !0;
                var t = s.val().replace(/ /g, ""), e = {keyword: t = t.replace("+", "%2B")};
                if (a.dataHandler) e = a.dataHandler(t); else e = {keyword: t};
                t ? $.post(a.url, e, function (t) {
                    if (a.disPlayData) a.callback(t, l); else {
                        var e = "", i = t.data || [];
                        if (0 == t.code) for (var n = 0, r = i.length; n < r; n++) {
                            var o = i[n];
                            e += '<div class="drop-tip-item t-l" data-value="' + o.kh_value + '" data-type="' + o.kh_type + '"><span>' + o.kh_word + '</span><span class="c-gray">&nbsp;&nbsp;' + o.kh_region_name + "</span></div>"
                        } else console.log(t.message);
                        l.html(e), "" == e && p(), $(".drop-tip-item").click(function () {
                            a.callback(this)
                        })
                    }
                    l.show()
                }, "json") : p()
            }, 500), n = !1)
        };
        $(t).append(l), p(), s.bind("input propertychange", o), "app" != a.platform && (s.bind("blur", function () {
            setTimeout(function () {
                p()
            }, 200)
        }), s.bind("keyup", r))
    }, r.getPositionByAddr = function (e, i, n, t) {
        (new BMap.Geocoder).getPoint(e, function (t) {
            !i instanceof Function || (!0 === n ? null == t ? i(null, null) : i(t.lng, t.lat) : null != t ? i(t.lng, t.lat) : $.messager.alert("警告", "无法获取到地址<" + e + ">的坐标"))
        }, null != t && "" != t ? t : e)
    }, r.source_page = function () {
        var t = "";
        return 0 < document.referrer.length && (t = document.referrer), "undefined" != typeof opener && null != opener && 0 == t.length && 0 < opener.location.href.length && (t = opener.location.href), t
    }, r.tag_data = function (t) {
        var e = "", i = null;
        for (var n in t) i = t[n], t.hasOwnProperty(n) && (e += e ? ',"' + n + '":"' + i + '"' : '{"' + n + '":"' + i + '"');
        return e += "}"
    }, r.checkAll = function (t) {
        $(t).parent().find("input[type=checkbox]").prop("checked", !0)
    }, r.cancelAll = function (t) {
        $(t).parent().find("input[type=checkbox]").prop("checked", !1)
    }, r
}(base || {});